import { Opt } from '__com/Opt.js'

export class columns extends Opt {
  constructor(vm) {
    super(vm)
  }

  create() {
    return [
      {
        title: '下载内容',
        field: 'name',
        minWidth: 100
      },
      {
        title: '所属组织',
        field: 'orgName',
        minWidth: 160
      },
      {
        title: '模块',
        field: 'module',
        minWidth: 180
      },
      {
        title: '操作人',
        field: 'createName',
        minWidth: 160
      },
      {
        title: '操作时间',
        field: 'createTime',
        minWidth: 160
      },
      {
        title: '操作',
        width: 100,
        cell: (info) => {
          return {
            btn: [
              {
                title: info.status == 2 ? '下载' : info.statusName,
                color: info.status == 2 ? '#2d8cf0' : '#e8eaec',
                cursor: info.status == 2 ? 'pointer' : 'auto',
                click: () => {
                  if (info.status != 2) return false
                  this.downloadFn(info)
                }
              }
            ]
          }
        }
      }
    ]
  }
}
